<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>滴答办公系统-流程审批</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="media/layui/css/layui.css" media="all">
<script type="text/javascript" src="media/js/jquery.min.js"></script>
</head>
<body>
	<div class="layui-container" style="margin-top: 5px">
		<form class="layui-form layui-form-pane" action="processadd.do" method="post" >
			<div class="layui-form-item">

					<label class="layui-form-label">起始日期</label>
					<div class="layui-input-block">
						<input type="text" name="startDate" class="layui-input mydate">
					</div>

			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">结束日期</label>
				<div class="layui-input-block">
					<input type="text" name="endDate" class="layui-input mydate">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">涉及天数</label>
				<div class="layui-input-inline">
					<input type="number" name="days" class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">天</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">操作类型</label>
				<div class="layui-input-block">
					<select name="type" >
						<option value="-1">--请选择类型--</option>
						<option value="请假">请假</option>
						<option value="调休">调休</option>
						<option value="加班">加班</option>
						<option value="外出">外出</option>
					</select>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">审批领导</label>
				<div class="layui-input-block">
					<select name="rname"  id="cds">
						<option value="-1">--请选择领导--</option>
						<option value="张三">张三</option>
					</select>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">说明信息</label>
				<div class="layui-input-block">
					<input name="info" placeholder="请输入原因" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<input class="layui-btn" style="margin-left: 10%" id="btn1" type="submit" value="添加申请">
			</div>
		</form>
	</div>
	<script src="media/layui/layui.js"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
	var form;
		layui
				.use(
						[ 'form', 'laydate' ],
						function() {
							form = layui.form, laydate = layui.laydate;
							//日期
                            lay('.mydate').each(function(){
                                laydate.render({
                                    elem: this
                                });
                            });
							//自定义验证规则
							form.verify({
								title : function(value) {
									if (value.length < 5) {
										return '标题至少得5个字符啊';
									}
								},
								pass : [ /(.+){6,12}$/, '密码必须6到12位' ],
								content : function(value) {
									layedit.sync(editIndex);
								}
							});
					initData();
		});
		//初始化数据
		function initData() {
			$.get("departall.do",null,function(arr){
				for(i=0;i<arr.length;i++){
					$("#cds").append("<option value='"+arr[i].id+"'>"+arr[i].name+"</option>");
				}
				form.render("select");
			});
		}
	</script>
</body>
</html>